﻿using Api.Models;
using Api.ViewModels.News;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Api.Controllers.News
{
    [Authorize]
    public class NewsSearchController : Controller
    {
        //LayansContext db = new LayansContext();

        const int PageSize = 9;
        //
        // GET: /NewsSearch/
        public ActionResult Index()
        {
            return View();
        }

        //public ActionResult Search(SubmitSearchViewModel submitModel)
        //{
        //    var layans = db.NewsInfos.All();

        //    if (!string.IsNullOrEmpty(submitModel.Info))
        //    {
        //        layans = layans.Where(x => x.Description.ToLower().Containst(submitModel.Info.ToLower()));
        //    }

        //    if (!string.IsNullOrEmpty(submitModel.Description))
        //    {
        //        layans = layans.Where(x => x.Info.ToLower().Containst(submitModel.Info.ToLower()));
        //        //layans = layans.Where(x => x.Description.ToLower().Containst(submitModel.Description.ToLower()));
        //    }
        //    var endResult = layans.Select(
        //       x => new SubmitSearchViewModel
        //        {
        //            Description = x.Description,
        //            Info = x.Info,
        //        }
        //    );
        //}

        public ActionResult List (int? Id)
        {
            int pageNumber = Id.GetValueOrDefault(1);

            

            return View();
        }

	}
}